<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .flex-container {
            display: flex;
            background-color: lightgrey;
            padding: 10px;
            height: 200px;
        }

        .flex-item {
            margin: 5px;
            background-color: lightblue;
            text-align: center;
            line-height: 50px;
            /* 垂直居中 */
        }

        .flex-item:nth-child(1) {
            flex-grow: 1;
        }

        .flex-item:nth-child(2) {
            flex-grow: 2;
        }

        .flex-item:nth-child(3) {
            flex-grow: 3;
        }
    </style>
</head>

<body>
    <p>flex-grow属性定义项目的放大比例，默认为0，即如果存在剩余空间，也不放大。可以写小数。</p>
    <div class="flex-container">
        <div class="flex-item">1</div>
        <div class="flex-item">2</div>
        <div class="flex-item">3</div>
    </div>
</body>

</html>